<?php

require_once dirname(__FILE__).'/../lib/carga_horariaGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/carga_horariaGeneratorHelper.class.php';

/**
 * carga_horaria actions.
 *
 * @package    sistema_estadisticas
 * @subpackage carga_horaria
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class carga_horariaActions extends autoCarga_horariaActions
{

	public function execute($request)
	{
		$planificacion_id = $request->getUrlParameter('planificacion_id');
		$this->forward404Unless($planificacion_id);

		$this->getContext()->getRouting()->setDefaultParameter('planificacion_id', $planificacion_id);

		if ($id = $request->getUrlParameter('id'))
			$this->getContext()->getRouting()->setDefaultParameter('id', $id);

		return parent::execute($request);
	}

	protected function buildQuery()
	{
		$query = parent::buildQuery();
		$query->addWhere('planificacion_id = ?', $this->getRequest()->getUrlParameter('planificacion_id'));
		return $query;
	}

}
